[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
memicmp() Compare Characters in Two Buffers
#include <mem.h> Required for declarations only
#include <string.h> Use either string.h or memory.h
int memicmp(buf1,buf2,cnt);
const void *buf1; First buffer;
const void *buf2; Second buffer;
size_t cnt; Number of characters
memicmp() performs a case-insensitive comparison of 'cnt' characters
of 'buf1' and 'buf2'. memicmp() differs from memcmp() in that case
does not matter; that is, 'a' equals 'A' in memicmp().
Returns: A value indicating the relationship between the two
buffers:
Result Return Value
'buf1' < 'buf2' < 0
'buf1' == 'buf2' 0
'buf1' > 'buf2' > 0
-------------------------------- Example ---------------------------------
The following statements compare the first 35 characters of 'buffr1'
and 'buffr2'.
#include <mem.h>
char buffr1[40] = "Now is the time for all good men...";
char buffr2[40] = "NOW IS THE TIME FOR ALL GOOD MEN...";
int rslt;
main()
{
rslt = memicmp(buffr1,buffr2,35);
if (rslt == 0)
printf("buffers are equal");
else
printf("buffers are not equal");
}
See Also:
memcmp()
memcpy()
memset()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson